<template>
  <div>
    <span>用户名</span>
    <input type="text" v-model="obj.uname">
    <span>密码</span>
    <input type="password" v-model="obj.password">
  </div>
</template>

<script>
  export default {
    data() {
      return {
        obj: {
          uname: '',
          password: ''
        }

      }
    },
    watch: {
      obj: {
        handler(newval, oldval) {
          console.log(newval, oldval);

        },
        deep: true,
        immediate: true
      }

    }
  }
</script>

<style>

</style>